package com.nondo.rdp.finance.domain;

import com.nondo.rdp.core.domain.base.BaseEntity;
import com.nondo.rdp.finance.config.DbConfig;
import org.hibernate.validator.constraints.Length;

import javax.persistence.*;
import javax.validation.constraints.NotNull;

/**
 * 热门搜索
 */
@Entity
@Table(name = DbConfig.DEFAULT_TABLE_PREFIX + "hot_search")
public class HotSearch extends BaseEntity {
	private static final long serialVersionUID = -8276230484998209212L;
    private Long id;            //主键ID
    private String keyWord;        //关键词
    private int sort;           //排序值

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @NotNull(message = "关键词不能为空")
    @Length(min = 2, max = 12, message = "关键词长度必须介于2到12之间")
    @Column(name = "key_word", length = 20)
	public String getKeyWord() {
		return keyWord;
	}

	public void setKeyWord(String keyWord) {
		this.keyWord = keyWord;
	}

	public int getSort() {
		return sort;
	}

	public void setSort(int sort) {
		this.sort = sort;
	}

}
